package com.ketai.appinfo.service;
import com.ketai.appinfo.mapper.AppInfoMapper;
import com.ketai.appinfo.param.ParamInsert;
import com.ketai.appinfo.param.ParamSelectByIf;
import com.ketai.appinfo.pojo.AppInfo;
import com.ketai.appinfo.vo.UserList;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
*@Author 刘玉琼
*@Time 2020-11-03
*
*/
@Service
@Transactional
public class AppInfoService{

    @Resource
    private AppInfoMapper appInfoMapper;

  /* *//* *
     * 显示后台app管理信息
     * @return
     *//*
    public Page<UserList> backUserFind(ParamSelectByIf p) {
        Integer pageIndex=p.getPageIndex()==null?1:p.getPageIndex();
        Integer pageSize=p.getPageSize()==null?3:p.getPageSize();
        Page<UserList> userListPage= PageHelper.startPage(pageIndex,pageSize);
        appInfoMapper.backUserList(p);
        return userListPage;
    }*/

    /**
     * 新增
     * @param p
     * @return
     */
    public Integer devAppAdd(ParamInsert p) {
        return appInfoMapper.devAppAdd(p);
    }

    /**
     * 删除
     * @param id
     * @return
     */
    public Boolean devAppDel(Integer id) {
        return appInfoMapper.devAppDel(id);
    }

    /**
     * 根据开发者id查 apkName
     */
    public AppInfo selectByAppId(Integer devId) {
        return appInfoMapper.appInfoSelectById(devId);
    }

    /**
     * 根据开发者id修改更新版本号
     * @param id
     * @param appid
     * @return
     */
    public Integer updateVersionId(Integer id, Integer appid) {
        return  appInfoMapper.updateVersionId(id,appid);
    }
}
